<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      .one{
        color: red;
      }
    </style>
    <!-- 引入vue3 js库 -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
        {{num}}
        <button v-on:click="add(1)">加</button>
        <button @:click="subract(1)">减</button>
    </div>
    <script>
        Vue.createApp({
            data(){
                return{
                    num:1
                }
            },
            methods:{
                add(value){
                    this.num += value
                    console.log(event.target)
                },
                subract(value){
                    this.num -= value
                }
            }

        }).mount("#app")
    </script>
</body>
</html>



